<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <title>我是代理</title>
    <link rel="icon" href="/template/pc1/images/wmh_favicon.ico" type="image/x-icon"/>

    <link type="text/css" rel="stylesheet" href="/template/default/css/font-awesome.min.css"/>
    <link rel="stylesheet" href="/template/default/css/common.css">
    <link type="text/css" rel="stylesheet" href="/template/default/css/custom_common.css"/>

    <script type="text/javascript" src="https://static.9hive.cn/global/vendor/jquery/jquery-2.1.4.min.js"></script>
    <script type="text/javascript" src="https://static.9hive.cn/global/vendor/layer/layer.js"></script>
    <style>
        .layui-layer-content {
            background-color: rgba(0,0,0,0.4);
            color: white;
        }


    </style>
</head>
<body>

<a class="tabbar" href="javascript:history.back(-1)" title="返回"><img
        src="/template/default/images/arrow_left_white.png"/><label>我是代理</label></a>
<div class="padding-15">
    <div class=" grey-700">
        <div> 微米荟商城所有商家入驻都应当由代理推荐，如果您成为代理，您将获得您推荐的商家的销售额抽成，还有更多的收入和惊喜！！
        </div>
        <div> 即使您年龄大了，退休了，只要商家在商城上卖出商品，您都有抽成的，受益终生！！
        </div>
        <div> 如果您想成为代理，请电话联系16605930023，或者留下您的联系方式，我们会在一个工作日内与您联系的。
        </div>

    </div>
    <!--不是代理商，显示申请按钮，否则显示输入密码，进入代理商wap端-->
    <%if(isEmpty(agentId)){%>
    <div class="margin-top-20 text-center">
        <div>
            <label class="width-70 text-right">姓名：</label><input class="light-input" id="name"/>
        </div>
        <div class="margin-top-20">
            <label class="width-70">联系方式：</label><input type="number" class="light-input" id="phone" value="${loginmMember.phone!}"/>
        </div>
        <button class="hive-btn hive-btn-primary margin-top-40 width-290" id="apply">立即申请</button>
    </div>
    <%}else{%>
    <div class="margin-top-20 text-center">
        <label>密码：</label><input type="password" class="light-input" name="agent-password" id="password"/>
        <button class="hive-btn hive-btn-primary margin-top-40 width-250" id="seeDetail">登陆查看</button>
    </div>
    <%}%>
</div>

<script>
    $(document).on('click', '#apply', function () {
        var name = $('#name').val();
        var phone = $('#phone').val();
        if (!name) {
            layer.msg("请输入姓名");
            return false;
        }
        if (!phone || phone.length != 11) {
            layer.msg("请输入正确的手机号码");
            return false;
        }

        $.ajax({
            url: '/b/agent/applyAgent',
            data: {
                phone: phone,
                name:name
            },
            success: function (data) {
                if (data.state == 'ok') {
                    layer.msg('申请成功')
                } else {
                    layer.msg(data.msg)
                }
            }
        })
    });
</script>
</body>
</html>